package com.campuscarbooking.api.service;

import com.campuscarbooking.api.dto.PageResponse;
import com.campuscarbooking.api.dto.ReservationDTO;
import com.campuscarbooking.api.model.Reservation;
import com.campuscarbooking.api.dto.request.ReservationRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.time.LocalTime;

public interface ReservationService {

    /**
     * 创建预约
     * @param scheduleId 班车ID
     * @param seatNumber 座位号
     * @param paymentMethod 支付方式
     * @return 预约信息
     */
    ReservationDTO createReservation(Long scheduleId, String seatNumber, String paymentMethod);

    /**
     * 获取我的预约列表
     * @param status 预约状态
     * @param startTime 开始时间
     * @param endTime 结束时间
     * @param page 页码
     * @param pageSize 每页大小
     * @return 预约列表分页数据
     */
    PageResponse<ReservationDTO> getMyReservations(
            Reservation.Status status,
            LocalTime startTime,
            LocalTime endTime,
            int page,
            int pageSize);

    /**
     * 取消预约
     * @param id 预约ID
     * @return 取消后的预约信息
     */
    ReservationDTO cancelReservation(Long id);

    /**
     * 签到
     * @param id 预约ID
     * @param signInMethod 签到方式
     * @param latitude 纬度
     * @param longitude 经度
     * @return 签到后的预约信息
     */
    ReservationDTO signIn(Long id, String signInMethod, Double latitude, Double longitude);

    Page<Reservation> getUserReservations(Long userId, Reservation.Status status, Pageable pageable);
    Reservation getUserReservation(Long reservationId, Long userId);
    Reservation createReservation(Long userId, ReservationRequest request);
    Reservation cancelReservation(Long reservationId, Long userId);
    Reservation checkInReservation(Long reservationId);
} 